home *** CD-ROM | disk | FTP | other *** search
- on Black
- return 255
- end
-
- on InitDataRange
- global dataFirst, dataLast
- set dataFirst to the number of cast "A B A"
- set dataLast to the number of cast "zur├╝ckhaltend"
- end
-
- on MouseIsHot
- global textSpr
- if rollOver(textSpr) then
- set w to the mouseWord
- if w < 1 then
- return 0
- exit
- end if
- set TextCastNo to the castNum of sprite textSpr
- set itsColour to the foreColor of word w of field TextCastNo
- if itsColour = Black() then
- return 0
- else
- return 1
- end if
- else
- return 0
- end if
- end
-
- on LaptopRollOvers
- if MouseIsHot() then
- set n to the number of cast "Hand"
- cursor([n, n + 1])
- else
- cursor(0)
- end if
- end
-
- on SpotSpr
- return 40
- end
-
- on LightOn
- puppetSprite(SpotSpr(), 1)
- set the locH of sprite SpotSpr() to the mouseH
- set the locV of sprite SpotSpr() to the mouseV
- updateStage()
- end
-
- on LightOff
- set the locH of sprite SpotSpr() to -100
- updateStage()
- end
-
- on OutOfRange wordno
- global textSpr
- set TextCastNo to the castNum of sprite textSpr
- set nWords to the number of words in field TextCastNo
- put wordno > nWords
- return wordno > nWords
- end
-
- on HotWord checkWord
- global textSpr
- set TextCastNo to the castNum of sprite textSpr
- return the foreColor of word checkWord of field TextCastNo = Blue()
- end
-
- on GetWord wordno
- global textSpr
- set TextCastNo to the castNum of sprite textSpr
- set theWord to word wordno of field TextCastNo
- return theWord
- end
-
- on KillEndSplitter theWord
- delete char -30000 of theWord
- if the last char in theWord = "'" then
- delete char -30000 of theWord
- end if
- return theWord
- end
-
- on EndsWithSplitter theWord
- set testChar to the last char in theWord
- if getPos([".", ",", ";", "'", ")"], testChar) > 0 then
- return 1
- exit
- else
- if testChar = "s" then
- set wordCopy to theWord
- delete char -30000 of wordCopy
- set CheckAlso to the last char in wordCopy
- if CheckAlso = "'" then
- return 1
- exit
- else
- return 0
- exit
- end if
- end if
- end if
- end
-
- on KillStartSplitter theWord
- delete char 1 of theWord
- return theWord
- end
-
- on StartsWithSplitter theWord
- set testChar to char 1 of theWord
- if testChar = "(" then
- return 1
- exit
- end if
- return 0
- end
-
- on GetPhrase
- global gMouseWord
- set thePhrase to EMPTY
- set subPhrase1 to EMPTY
- if not StartsWithSplitter(GetWord(gMouseWord)) then
- set lookAt to gMouseWord - 1
- repeat while 1
- if lookAt = 0 then
- exit repeat
- end if
- if not HotWord(lookAt) then
- exit repeat
- end if
- set theWord to GetWord(lookAt)
- if EndsWithSplitter(theWord) then
- exit repeat
- end if
- set subPhrase1 to theWord && subPhrase1
- if StartsWithSplitter(theWord) then
- exit repeat
- end if
- set lookAt to lookAt - 1
- end repeat
- end if
- if the last char in subPhrase1 = " " then
- delete char -30000 of subPhrase1
- end if
- set lookAt to gMouseWord
- repeat while 1
- set theWord to GetWord(lookAt)
- set subPhrase2 to subPhrase2 && theWord
- if EndsWithSplitter(theWord) then
- exit repeat
- end if
- set lookAt to lookAt + 1
- if OutOfRange(lookAt) then
- exit repeat
- end if
- if not HotWord(lookAt) then
- exit repeat
- end if
- set nextWord to GetWord(lookAt)
- if StartsWithSplitter(nextWord) then
- exit repeat
- end if
- end repeat
- if char 1 of subPhrase2 = " " then
- delete char 1 of subPhrase2
- end if
- set thePhrase to subPhrase1 && subPhrase2
- if EndsWithSplitter(thePhrase) then
- set thePhrase to KillEndSplitter(thePhrase)
- if EndsWithSplitter(thePhrase) then
- set thePhrase to KillEndSplitter(thePhrase)
- end if
- end if
- if char 1 of thePhrase = " " then
- delete char 1 of thePhrase
- end if
- if StartsWithSplitter(thePhrase) then
- KillStartSplitter(thePhrase)
- end if
- return thePhrase
- end
-
- on LapTopClick
- global textSpr, FirstCast, lastArticle, returnPhrase, gMouseWord
- set gMouseWord to the mouseWord
- if MouseIsHot() then
- LightOn()
- repeat while the mouseDown
- nothing()
- end repeat
- LightOff()
- WatchCursor()
- set mousePhrase to GetPhrase()
- put mousePhrase
- set newarticle to phraseLookUp(mousePhrase)
- if newarticle > 0 then
- set the castNum of sprite textSpr to newarticle
- updateStage()
- StepOn(the name of cast newarticle, newarticle)
- else
- beep()
- end if
- end if
- end
-
- on KillLaptopPuppets
- repeat with i = 32 to 40
- puppetSprite(i, 0)
- end repeat
- end
-
- on CloseLaptop
- puppetSprite(the clickOn, 1)
- set the castNum of sprite the clickOn to the castNum of sprite the clickOn + 1
- updateStage()
- repeat while the mouseDown
- end repeat
- puppetSprite(the clickOn, 0)
- updateStage()
- KillLaptopPuppets()
- end
-
- on PreLoadLaptop
- preLoadCast("laptop First", "laptop last")
- end
-